package com.lc.baseres.base;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.lc.baselib.utils.ToastUtil;
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;

import javax.inject.Inject;

/**
 * @author LiuChao
 * @describe
 * @date 2018/6/21
 * @contact email:450127106@qq.com
 */
public abstract class BaseActivity<P extends IPresenter> extends RxAppCompatActivity implements IActivity {
    @Inject
    protected P mPresenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getContentView());
        setupActivityComponent(BaseApplication.getAppComponent());
        initData(savedInstanceState);
    }

    public void showMessage(@NonNull String msg) {
        ToastUtil.showMessage(this, msg);
    }
}
